<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>工程合同详情</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="../../../resources/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="../../../resources/css/style.css" media="all">
    <style>
        .details li{width: 50%;float: left;}
        .layui-table thead th{text-align: left;}
        .engineering_c{margin-top: 10px;}
        .engineering_c li{width: 100%;}
        .shenheBtn{float: right; margin-top: 10px;}
        .s_hide{margin-top: 10px;}
        .layui-select-title input{width: 100%;margin-bottom: 10px;margin-top: 10px;}
        .layui-input{width: 100%;}
        .layui-form-pane .layui-form-label{width: 100px;}
        .layui-form-select{width: 100%;}
        .imgs img{width: 100px;height: 100px;}
        html{height: 100%;background-color: #FFF;}
        .MOVE_main{padding: 15px;background-color: #FFF;}
        .MOVE_main p{height: 35px;line-height: 35px;width: 100%;}
        .jiange{border-bottom: 3px solid #DBE6FC;margin-bottom: 20px;}
        .MOVE_mainL{width: 100px; display: inline-block;}
        .imgs{width: 100px;height: 100px;}
    </style>
</head>
<body>
<div class="_PC">
    <button class="layui-btn" type="button" onclick="history.back(-1);"><i class="layui-icon"></i></button>
    <div class="shenpiSeeS"></div>
    <form class="layui-form layui-form-pane " action="" >

        <div class="engineering"><!--工程信息-->
            <!--<div class="titles"></div>-->
            <div class="details">
                <!--<ul>-->
                <!--<li><span class='detaL'>工程名称：</span><span class="dataR">  西三环通讯管道施工 </span></li>-->
                <!--<li><span class='detaL'>申请单位：</span><span class="dataR"> 厂北路-郑上路</span></li>-->
                <!--<li><span class='detaL'>签证内容：</span><span class="dataR">郑州市金水路花园路</span></li>-->
                <!--<li><span class='detaL'>申请人：</span><span class="dataR"> 厂北路-郑上路</span></li>-->
                <!--<li><span class='detaL'>签证人：</span><span class="dataR">郑州市金水路花园路</span></li>-->
                <!--<li><span class='detaL'>审核状态：</span><span class="dataR">尚未供料</span></li>-->
                <!--<li><span class='detaL'>创建时间：</span><span class="dataR">2017年7月15日</span></li>-->
                <!--<li><span class='detaL'>签证时间：</span><span class="dataR">  西三环通讯管道施工 </span></li>-->
                <!--<li><span class='detaL'>现场图片：</span><span class="dataR">尚未供料</span></li>-->

                <!--</ul>-->
            </div>
            <!--<div class="details detailsBot">-->
            <!--<ul>-->
            <!--<li><span class='detaL'>项目名称：</span><span class="dataR">  西三环通讯管道施工 </span></li>-->
            <!--<li><span class='detaL'>状态：</span><span class="dataR">尚未供料</span></li>-->
            <!--<li><span class='detaL'>施工单位：</span><span class="dataR"> 厂北路-郑上路</span></li>-->
            <!--<li><span class='detaL'>供货地址：</span><span class="dataR">郑州市金水路花园路</span></li>-->
            <!--<li><span class='detaL'>供货时间：</span><span class="dataR">2017年7月15日</span></li>-->

            <!--</ul>-->

            <!--</div>-->
            <table class="layui-table">
                <thead>
                    <tr>
                        <th>材料名称</th>
                        <th>材料规格</th>
                        <th>材料单位</th>
                        <th>单价</th>
                        <th>数量</th>
                        <th>小计</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <!--<td>111</td>-->
                        <!--<td>111</td>-->
                        <!--<td>111</td>-->
                        <!--<td>111</td>-->
                        <!--<td>111</td>-->
                        <!--<td>111</td>-->
                    </tr>

                </tbody>
            </table>

        </div>



    </form>

</div>

<div class="_MOVE">
    <div class="MOVE_title">
        <div class="site-tree-mobile layui-show houtui" onclick="history.back(-1);">
            <i class="layui-icon">&#xe603;</i>
        </div>
        <span class="zhanwei"></span>
        <p class="MOVE_biaoti">申请签证详情</p>
        <span class="shousuo"><a href="./hetongqianzhengGAIMOVE.html" style="color: #FFFFFF;">编辑</a></span>

    </div>
    <script id="demos" type="text/html">
        {{#  layui.each(d.data, function(index, item){ }}
        <p><span class="MOVE_mainL">合同编号:</span><span class="MOVE_mainR">{{item.cc_Code}}</span></p>
        <p><span class="MOVE_mainL">项目名称:</span><span class="MOVE_mainR">{{item.eppName+' '+item.eppStaEnd}}</span></p>
        <p><span class="MOVE_mainL">申请单位:</span><span class="MOVE_mainR">{{item.compName1}}</span></p>
        <p class="jiange"><span class="MOVE_mainL">提交时间:</span><span class="MOVE_mainR">{{item.s_Time}}</span></p>
        <p><span class="MOVE_mainL">审核人:</span><span class="MOVE_mainR">{{item.createUser}}</span></p>
        <p class="zhuangtai"><span class="MOVE_mainL">审核状态:</span><span class="MOVE_mainR">{{item.state}}</span></p>
        <p class="jiange"><span class="MOVE_mainL">审核意见:</span><span class="MOVE_mainR">{{item.s_Opinion}}</span></p>
        <p><span class="MOVE_mainL">签证人:</span><span class="MOVE_mainR">{{item.s_Person}}</span></p>
        <p><span class="MOVE_mainL">签证内容:</span><span class="MOVE_mainR">{{item.s_Content}}</span></p>
        <p class="tupian"><span class="MOVE_mainL">现场图:</span><span class="MOVE_mainR"></span></p>
        {{#  }); }}




        {{#  if(d.data.state === -1){ }}
        {{# d.data.state ='等待审核'}}
        {{#  }else if(d.data.state === 0){ }}
        {{# d.data.state ='审核通过'}}
        {{# } }}
        {{#  if(d.data.length === 0){ }}
        无数据
        {{#  } }}

    </script>


    <div class="MOVE_main" id="MOVE_main">


    </div>


</div>





<script src="../../../resources/layui/layui.js" charset="utf-8"></script>
<script src="../../../resources/js/style.js"></script>
<script src="../../../resources/js/api.js"></script>
<script>


    layui.use(['form', 'layedit', 'laydate','table','laytpl'], function(){
        var form = layui.form
            ,layer = layui.layer
            ,layedit = layui.layedit
            ,table=layui.table
            ,laytpl=layui.laytpl
            ,laydate = layui.laydate;
        var transmit=new Object();      //接受数据传递  发送ajax需调用

        if(sessionStorage.stear=='detail'){
            $('.shenpiSee').hide();
            $('.shent').hide();
        }else{
            $('.shenpiSee').show();
            $('.shent').show();
        }
        ajaxs('/api/supply/loadJSHistoryDetails.do','post',{'type':'b','ct_id':sessionStorage.ct_Id,'p':getCookie('yanzheng')},function (data) {
            //console.log(data,'--------------------------')
            var datas=data.data[0];

            //console.log(datas.state)
            switch (datas.state){
                case -1:
                    datas.state='等待签证'
                    break;
                case 0:
                    datas.state='签证完成'
                    break;
            }

            if(!datas.totalPrice){
                datas.totalPrice='';
            }


            $('._PC .details').append(' <ul>\n' +
                '                    <li><span class=\'detaL\'>工程名称：</span><span class="dataR">'+datas.proName+'</span></li>\n' +
                '                    <li><span class=\'detaL\'>经办人：</span><span class="dataR">'+datas.createUser+'</span></li>\n' +
                '                    <li><span class=\'detaL\'>结算单单号：</span><span class="dataR">'+datas.ct_Id+'</span></li>\n' +
                '                    <li><span class=\'detaL\'>创建时间：</span><span class="dataR">'+datas.createTime+'</span></li>\n' +
                '                    <li><span class=\'detaL\'>决算金额：</span><span class="dataR">'+datas.totalPrice+'</span></li>\n' +
                '                </ul>');
            var datas1=data.data;
            for(var i=0;i<datas1.length;i++){
                var zongshu=0;
                zongshu+=datas1[i].mat_Price*datas1[i].mat_Num;
                zongshu+=datas1[i].mat_Tax*datas1[i].mat_Price*datas1[i].mat_Num;
                $('.layui-table tbody').append('<tr><td>'+datas1[i].mat_Name+'</td>\n' +
                    '                        <td>'+datas1[i].mat_Spec+'</td>\n' +
                    '                        <td>'+datas1[i].mat_Bit+'</td>\n' +
                    '                        <td>'+datas1[i].mat_Price+'</td>\n' +
                    '                        <td>'+datas1[i].mat_Num+'</td>\n' +
                    '                        <td>'+zongshu+'</td></tr>')
            }

        })

        return;
        ajaxs('/api/buil/builSignHisDetail.do','post',{'cs_id':sessionStorage.cs_id,'p':getCookie('yanzheng')},function (datas) {
            var transmit=datas;
            //console.log(transmit)

            if(datas.code=='0'){
                var data=datas.data
                var imgswarp=new Array();
                var getTpl = demos.innerHTML
                    ,view = document.getElementById('MOVE_main');
                laytpl(getTpl).render(transmit, function(html){
                    view.innerHTML = html;
                });
                for(var i=0;i<datas.data.length;i++){                       //循环判断更改审核 状态为文字
                    //console.log(i)
                    switch (data[i].state){
                        case 0:
                            data[i].state='通过';
                            break;
                        case -1:
                            data[i].state='等待审核';
                            break;
                    }

                    imgswarp=data[i].s_Img;                                //获取图片的地址
                    imgswarp=imgswarp.split(',');                           //分割为数组
                    //console.log(imgswarp)
                    for(var j=0;j<imgswarp.length;j++){                     //循环添加
//                        $('.imgs').append('<img src="'+imgswarp[i]+'" alt="获取图片出错"/>');
                        $('.tupian').children('.MOVE_mainR').append('<img class="imgs" src="'+imgswarp[j]+'" alt="获取图片出错"/>')
                    }
                }
                var zhi=$('.zhuangtai').children('.MOVE_mainR')
                zhi.each(function () {
                    if($(this).text()==-1){
                        $(this).text('等待审核')
                    }else{
                        $(this).text('审核通过')
                    }
                })



            }else{
                layer.msg('获取失败 请重新尝试')

            }
        })




    })

</script>
</body>
</html>